package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.HolidayDaoEntity;
import com.sxx.beautifulcity.entity.greendao.HolidayDaoEntityDao;
import com.sxx.beautifulcity.entity.greendao.VillageDaoEntity;
import com.sxx.beautifulcity.entity.greendao.VillageDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/4.
 * 度假村
 */
public class HoldayVillageHelper {

    private DaoSingleton instance = DaoSingleton.getInstance();
    private HolidayDaoEntityDao holidayDao;


    public HoldayVillageHelper(){
        this.holidayDao = instance.getHolidayDao();
    }

    public void saveAllVillage(List<HolidayDaoEntity> daoEntities){
        holidayDao.insertInTx(daoEntities);
    }

    public void deleteAllvillage(){
        holidayDao.deleteAll();
    }

    public List<HolidayDaoEntity> queryAllVillage(){
        return holidayDao.loadAll();
    }

}
